package Level_two;

import java.util.Scanner;

public class Thirteen {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入机票原价：");
        double price = scanner.nextDouble();
        System.out.println("请输入出行月份：");
        int month = scanner.nextInt();
        System.out.println("请输入仓位（经济舱或者头等舱）：");
        String seat = scanner.next();
        if (month >= 4 && month <= 10) {
            if (seat.equals("头等舱")) {
                price = price * 0.9;
            } else if (seat.equals("经济舱")) {
                price = price * 0.8;
            } else {
                System.out.println("选个仓位，牢底，没站位");
            }
        } else if (month > 0 && month <= 12) {
            if (seat.equals("头等舱")) {
                price = price * 0.5;
            } else if (seat.equals("经济舱")) {
                price = price * 0.4;
            } else {
                System.out.println("选个仓位，牢底，没站位");
            }
        }else {
            System.out.println("输入的月份有误");
        }
        System.out.println("机票价格为：" + price);
    }
}

